package com.bitinstitute.parkapp;

import android.app.TabActivity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

import com.bitinstitute.parkapp.googlemaps.MapActivity;

@SuppressWarnings("deprecation")
public class MenuTabLayoutActivity extends TabActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
    	this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        TabHost tabHost = getTabHost();
        
        // Tab for Home
        TabSpec homespec = tabHost.newTabSpec("Home");
        homespec.setIndicator("Home", getResources().getDrawable(R.drawable.icon_home_tab));
        Intent homeIntent = new Intent(this, HomeActivity.class);
        homespec.setContent(homeIntent);
        
        // Tab for Map
        TabSpec mapspec = tabHost.newTabSpec("Parkplan");
        mapspec.setIndicator("Parkplan", getResources().getDrawable(R.drawable.icon_map_tab));
        Intent mapIntent = new Intent(this, MapActivity.class);
        mapspec.setContent(mapIntent);
        
        // Tab for Animals
        TabSpec animalspec = tabHost.newTabSpec("Tiere");
        animalspec.setIndicator("Tiere", getResources().getDrawable(R.drawable.icon_animal_tab));
        Intent animalIntent = new Intent(this, AnimalActivity.class);
        animalspec.setContent(animalIntent);
        
        // Tab for Plants
        TabSpec plantspec = tabHost.newTabSpec("Pflanzen");
        plantspec.setIndicator("Pflanzen", getResources().getDrawable(R.drawable.icon_plant_tab));
        Intent plantIntent = new Intent(this, PlantActivity.class);
        plantspec.setContent(plantIntent);
        
        // Tab for More...
        TabSpec morespec = tabHost.newTabSpec("Mehr");
        morespec.setIndicator("Mehr", getResources().getDrawable(R.drawable.icon_more_tab));
        Intent moreIntent = new Intent(this, MoreActivity.class);
        morespec.setContent(moreIntent);
        
        // Adding all TabSpec to TabHost
        tabHost.addTab(homespec); // Adding home tab
        tabHost.addTab(mapspec); // Adding map tab
        tabHost.addTab(animalspec); // Adding animal tab
        tabHost.addTab(plantspec); // Adding plant tab
        tabHost.addTab(morespec); // Adding more tab
        
    }
}